/**
 * The object defining a chat message and its information:
 * from who it is and to whom it is send.
 * 
 * The ChatEntry-class is used in an ArrayList in the
 * ChatImp-class and ChatInt-interface.
 * 
 * Created on 29 apr. 2011 @ 03:31:40 by Laurens Andriessen
 */

package combat.example.protocol.data;

import java.util.Date;

import combat.example.protocol.interfaces.ChatEntryInt;


/**
 * 
 * @author Laurens Andriessen
 * @version 1.0
 */
public class ChatEntry implements ChatEntryInt {

	private static final long serialVersionUID = 1L;

	private int userID = -1;
	private int targetID = -1;
	private Date timestamp = null;
	private String message = "";

	/**
	 * Constructor for making a new ChatEntry
	 * @param userID The sender's userID
	 * @param targetID The target's userID
	 * @param message The sender's message
	 */
	public ChatEntry(int userID, int targetID, String message) {
		this.userID = userID;
		this.targetID = targetID;
		this.timestamp = new Date(); // Current date and time (in milliseconds
										// since 1970)
		this.message = message;
	}

	public int getUserID() {
		return userID;
	}
	public void setUserID(int userID) {
		this.userID = userID;
	}

	public int getTargetID() {
		return targetID;
	}
	public void setTargetID(int targetID) {
		this.targetID = targetID;
	}

	public Date getTimestamp() {
		return timestamp;
	}
	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}

}
